﻿$(function () {
    var header = $('#header');
    var location = window.location.pathname;

    if (contains(location, 'Devocional'))
        header.css("background-image", "url('/Content/Layout/TopoDevocional.jpg')");

    if (contains(location, 'Noticia'))
        header.css("background-image", "url('/Content/Layout/TopoChegaMais.jpg')");

    if (contains(location, 'Evento'))
        header.css("background-image", "url('/Content/Layout/TopoSocial.jpg')");

    if (contains(location, 'LeituraBiblica'))
        header.css("background-image", "url('/Content/Layout/TopoLeituraBiblica.jpg')");

    if (contains(location, 'QuemSomos'))
        header.css("background-image", "url('/Content/Layout/TopoIdentidade.jpg')");

    if (contains(location, 'Musica'))
        header.css("background-image", "url('/Content/Layout/TopoMidia.jpg')");

    if (contains(location, 'FotosFlickr')) {
        header.css("background-image", "none");
        header.css("height", "100px");
        $('#menucontainer').css("margin-top", "10px");
        $('#menucontainer').addClass("divTexto");
        $('#logindisplay').hide();
    }
});

function contains(text, textToSearch) {
    return text.toUpperCase().indexOf(textToSearch.toUpperCase()) != -1;
} 